#include <string.h>
#include <stdio.h>
#include "my_stack.h"

void my_stack_push(struct my_stack *s, void *item)
{
	int top;
	
	top=s->top;
	
	if(top == MY_STACK_SIZE)
	{
		printf("Stack Full!\n");
		return;
	}
	s->item[top]=item;
	
	top++;
	s->top=top;
}
void *my_stack_pop(struct my_stack *s)
{
	int top;
	
	top=s->top;
	
	if(top == 0)
	{
		printf("Stack Empty!\n");
		return NULL;
	}
	
	top--;
	
	s->top=top;
	
	return s->item[top];
}
void my_stack_init(struct my_stack *s)
{
	memset(s,0,sizeof(struct my_stack));
}
